
.SUFFIXES: .sh .h .c .cc .cpp

AR        = ar
AR_FLAGS  = crs

CXX       = g++
CXXFLAGS  = -std=c++11 -ggdb3 -Wall -Werror

BASE_DIR  = ..
INC_DIR   = -I$(BASE_DIR) -I$(BASE_DIR)/sim_muduo_lib/pubh -I$(BASE_DIR)/sim_muduo_lib/prih
LIB_DIR   = ../sim_muduo_lib/obj

OBJ_DIR   = obj

CLIBS     = -L$(LIB_DIR) -lsim_muduo -pthread 
CLIBS    += 

TARGET= HttpServer

OBJS      = HttpServer.o HttpContext.o HttpResponse.o HttpServer_main.o

$(TARGET):$(OBJ_DIR) $(OBJS)
	${CXX} -o $(TARGET) $(OBJ_DIR)/*.o ${CLIBS}

$(OBJS):%.o:%.cpp
	$(CXX) -c $(CXXFLAGS) $(INC_DIR) $< -o $(OBJ_DIR)/$@

$(OBJ_DIR):
	@-mkdir -p $(OBJ_DIR)

clean:
	@-rm -rf $(OBJ_DIR)
	@-rm -r  $(TARGET)